/*顶级菜单：后台管理*/

export default {
    path: '/',
    component: 'Layout',
    meta: {title: '后台管理', icon: 'svg-home', sort: 0},
    // children: context2array(files)
    children:  [
        {
            path: 'index',
            component: 'admin/index/',
            name: 'index',
            meta: {title: '首页', affix: true, icon: 'svg-home', noAuth: true, pageHeader: false, sort: 0}
        },
        {
            path: 'user',
            name: 'userCenter',
            component: 'admin/userCenter/',
            meta: {title: '个人中心', noCache: true, icon: 'svg-user', noAuth: true, pageHeader: false, hidden: true},
        },
        {
            path: 'message',
            meta: {title: '消息中心', icon: 'svg-message'},
            children: [
                {
                    path: 'manage',
                    name: 'messageManagement',
                    component: 'admin/message/manage/',
                    meta: {title: '消息管理'}
                },
                {
                    path: 'user',
                    name: 'userMessage',
                    component: 'admin/message/user/',
                    meta: {title: '个人消息', noAuth: true, noCache: true}
                }
            ]
        },
        {
            path: 'honorwall',
            meta: {title: '荣誉墙管理', icon: 'svg-stock'},
            sort: 0,
            children: [
                {
                    path: 'wall',
                    name: 'honorWall',
                    component: 'admin/honorwall/wall/',
                    meta: {title: '荣誉发布'}
                },
                {
                    path: 'wall/detail/:type(see|add|edit)/:id?',
                    component: 'admin/honorwall/wall/detail',
                    meta: {
                        title: '荣誉墙详情页',
                        hidden: true,
                        pageHeader: false,
                        dynamicTitle(to) {
                            const {type, id} = to.params
                            switch (type) {
                                case 'add':
                                    return '添加荣誉证书'
                                case 'edit':
                                    return `编辑荣誉证书${id}`
                                case 'see':
                                    return `查看荣誉证书${id}`
                            }
                        },
                        activeMenu: '/honorwall/wall',
                        usePathKey: true
                    }
                },
            ]
        },
        {
            path: 'sell',
            meta: {title: '公告管理', icon: 'svg-sell'},
            children: [
                {
                    path: 'order',
                    name: 'sellOrder',
                    component: 'admin/notice/',
                    meta: {title: '公告发布'}
                },
                {
                    path: 'order/detail/:type(see|add|edit)/:id?',
                    component: 'admin/notice/detail',
                    meta: {
                        title: '公告发布详情页',
                        hidden: true,
                        pageHeader: false,
                        dynamicTitle(to) {
                            const {type, id} = to.params
                            switch (type) {
                                case 'add':
                                    return '添加公告'
                                case 'edit':
                                    return `编辑销售公告${id}`
                                case 'see':
                                    return `查看销售公告${id}`
                            }
                        },
                        activeMenu: '/notice',
                        usePathKey: true
                    }
                }
            ]
        },
        {
            path: 'system',
            meta: {title: '系统管理', icon: 'svg-system'},
            children: [
                {
                    path: 'menu',
                    name: 'menuManagement',
                    component: 'admin/system/menu/',
                    meta: {title: '菜单管理', noCache: true}
                },
                {
                    path: 'role',
                    name: 'roleManagement',
                    component: 'admin/system/role/',
                    meta: {title: '角色管理'}
                },
                {
                    path: 'user',
                    name: 'userManagement',
                    component: 'admin/system/user/',
                    meta: {title: '用户管理'}
                },
                {
                    path: 'type',
                    name: 'typeSetting',
                    component: 'admin/system/type/',
                    meta: {title: '公告分类'}
                }
            ]
        }
    ]
    
}